pp108 : expression Property

expression Property


String that specifies a piece of script that can be evaluated against the value specified in the entry.

Syntax

HTML

<ELEMENT id=elementID fieldType="sType" expression=sExpr...>...</ELEMENT>

Scripting

elementID.expression [ =sExpr ]


Parameters

Parameter

Description

sExpr

String that specifies a piece of script that can be evaluated against the value specified in the entry. This property can be used to check the value of one field against the other.


Example


The following example shows how theexpressionproperty can be used to evaluate whether the data entered in one text box is greater than the other. fields.

//validate definition inside the BODY
<div cordysType="wcp.library.util.Validate" id="validate" ></div>
//INPUT box with fieldType integer and some value in it
<input type="text" fieldType="integer" id="field1" value=14>
//INPUT box with fieldType integer and with some value greater than field1
<input type="text" fieldType="amount" id="field2" value=17 expression="parseInt(field1.value) > parseInt(field2.value)">

See Also


validate